package c8;

public class Weather {
    public double[][] average(double[][][] weather) {
        final int NUMBER_OF_DAYS = 10;
        final int NUMBER_OF_HOURS = 24;
        double[][] average = new double[2][10];

        // Find the average daily temperature and humidity
        for (int i = 0; i < NUMBER_OF_DAYS; i++) {
            double dailyTemperatureTotal = 0, dailyHumidityTotal = 0;
            for (int j = 0; j < NUMBER_OF_HOURS; j++) {
                dailyTemperatureTotal += weather[i][j][0];
                dailyHumidityTotal += weather[i][j][1];
            }

            average[0][i] = dailyTemperatureTotal / NUMBER_OF_HOURS;
            average[1][i] = dailyHumidityTotal / NUMBER_OF_HOURS;
        }
        return average;
    }
}
